//Sat 06 Feb 2010 10:48:41 AM CST 
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>

using namespace std;

class TheFansAndMeetingsDivTwo
{
public:
	double find(vector <int> minJ, vector <int> maxJ, vector <int> minB, vector <int> maxB)
	{
		int N = minJ.size();
		double ret = 0.0;
		for(int k=1; k<51; k++)
		{
			double ratio1 = 0.0;
			for(int i=0; i<N; i++)
			{
				for(int j=minJ[i]; j<=maxJ[i]; j++)
				{
					if(k == j)
					{
						ratio1 += 1.0/(maxJ[i]-minJ[i]+1)/N;
					}
				}
			}
			double ratio2 = 0.0;
			for(int i=0; i<N; i++)
			{
				for(int j=minB[i]; j<=maxB[i]; j++)
				{
					if(k == j)
					{
						ratio2 += 1.0/(maxB[i]-minB[i]+1)/N;
					}
				}
			}
			ret += ratio1 * ratio2;
		}
		return ret;
	}
};
